import App from './App'
import api from './common/api/api.js' //api 接口
import tui from './common/tui.js' // 普通的快速工具类
import store from './store' // 引入全局状态管理 Store
import utils from './utils/util.js' // 工具类
import constant from './constant/constant.js' // 常量
import cacheHelper from './common/cacheHelper.js' // 缓存工具类
import share from '@/common/share.js' // 导入并挂载全局的分享方法
import uView from '@/uni_modules/uview-ui'

import uitls from "./utils/index";
Vue.use(uitls);

// 字典标签组件
import DictTag from '@/components/dict-tag'
// 数据为空组件
import Empty from '@/components/empty'
// 图片预览组件
import ImagePreview from '@/components/image-preview'

// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('Empty', Empty)
Vue.component('ImagePreview', ImagePreview)

// 数据混入
import mixin from './mixins/index'
Vue.mixin(mixin)

// 登录拦截登录拦截
import './common/permission.js'
// 全局事件挂载
Vue.prototype.tui = tui
Vue.prototype.api = api
Vue.prototype.utils = utils
Vue.prototype.$store = store
Vue.prototype.constant = constant
Vue.prototype.cacheHelper = cacheHelper
Vue.mixin(share)

Vue.use(uView)
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	store,
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif